package com.kotlin.demo

import java.lang.reflect.Method
import java.util.regex.Pattern

fun main() {
    //apply 返回的
    val info: String = "lkjsdjfsljflsdlf"
    info.apply {
        println("info的长度$length")
    }.apply {
        println(info.split(Pattern.compile("j")))
    }


    //let
    val value: String?

    println(method("kdskjdl"))

}

fun method(value: String?) : String{
    return value?.let{
        "欢迎回来$it ll"
    }?:"null"
}




